package com.tang.lts.core.nio.channel;

import com.tang.lts.core.nio.codec.Decoder;
import com.tang.lts.core.nio.codec.Encoder;

/**
 * @author Tang
 * @classname ChannelInitializer
 * @description [  ]
 * @date 2022/5/12 23:05
 */
public abstract class ChannelInitializer {

    public void initChannel(NioChannel ch) {
        NioChannelImpl channel = (NioChannelImpl) ch;
        channel.setDecoder(getDecoder());
        channel.setEncoder(getEncoder());
    }

    protected abstract Decoder getDecoder();

    protected abstract Encoder getEncoder();

}